package com.lantosec.hmrp.modules.supplier.vo;

import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.supplier.entity.SupplierAccessory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 供应商附件信息 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="SupplierAccessory对象", description="供应商附件信息")
public class SupplierAccessoryVO extends BaseVO<SupplierAccessory> {
    private static final long serialVersionUID = 1L;


    public SupplierAccessoryVO(SupplierAccessory entity){
        this.accessoryId = entity.getAccessoryId();
        this.supplierCode = entity.getSupplierCode();
        this.accessoryType = entity.getAccessoryType();
        this.uploadId = entity.getUploadId();
        this.accessoryName = entity.getAccessoryName();
        this.validityBeginDate = entity.getValidityBeginDate();
        this.validityEndDate = entity.getValidityEndDate();
        this.createTime = entity.getCreateTime();
        this.crateUserId = entity.getCrateUserId();
        this.createUser = entity.getCreateUser();
    }

    @Override
    public SupplierAccessory convertToEntity(){
        return new SupplierAccessory(this);
    }


    @ApiModelProperty(value = "附件ID")
    private String accessoryId;

    @ApiModelProperty(value = "供应商编码")
    private String supplierCode;

    @ApiModelProperty(value = "附件类型，对应字典表ID")
    private String accessoryType;

    @ApiModelProperty(value = "上传附件表ID")
    private String uploadId;

    @ApiModelProperty(value = "附件名称")
    private String accessoryName;

    @ApiModelProperty(value = "有效期开始日期(yyyy-MM-dd)")
    private String validityBeginDate;

    @ApiModelProperty(value = "有效期结束日期(yyyy-MM-dd)")
    private String validityEndDate;

    @ApiModelProperty(value = "创建日期")
    private Date createTime;

    @ApiModelProperty(value = "创建人ID")
    private String crateUserId;

    @ApiModelProperty(value = "创建人")
    private String createUser;

    @ApiModelProperty(value = "上传文件")
    private MultipartFile file;

    @ApiModelProperty(value = "文件保存路径")
    private String savePath;
    @ApiModelProperty(value = "文件名")
    private String fileName;
    @ApiModelProperty(value = "附件类型名")
    private String accessoryTypeName;
}
